﻿using Abp.EntityFrameworkCore.Configuration;
using Abp.Modules;
using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;

namespace AppFramework.MetalialModel
{
    public class AbpDomainMaterModel : AbpModule
    {
        public override void Initialize()
        {
            IocManager.RegisterAssemblyByConvention(Assembly.GetExecutingAssembly());
            //base.Initialize();
        }

        public override void PreInitialize()
        {
            string connectionString = "Data Source=182.92.219.97;Initial Catalog=AppFrameworkDb;Persist Security Info=True;User ID=jin;Password=1222JCY...";
            Configuration.DefaultNameOrConnectionString = connectionString;
            Configuration.Modules.AbpEfCore().AddDbContext<DbContext>(options =>
            {
                options.DbContextOptions.UseSqlServer(connectionString);
            });
            //base.PreInitialize();
        }
    }
}
